Skip to contentSkip to conversation

Change in openvpn[master]: manage: Correctly handle port 65535 in man_kill

Openvpn-devel In review flichtenheld (Code Review) 2 participants 6 messages Nov 3, 2025 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): gerrit.1762170801000.I19373408a82332d7b2e5c634e5509c8be3727b5a@...2715...

#1 lore raw

Attention is currently required from: plaisthos.

Hello plaisthos,

I'd like you to do a code review.
Please visit

    http://gerrit.openvpn.net/c/openvpn/+/1341?usp=email

to review the following change.

Change subject: manage: Correctly handle port 65535 in man_kill
......................................................................

manage: Correctly handle port 65535 in man_kill

Commit c66d433111c958c42cc98f4ba12d3cfc1bd5b3b4 introduced an off-by-one when changing a literal to a constant.

Fixes #887
Change-Id I19373408a82332d7b2e5c634e5509c8be3727b5a

---
M src/openvpn/manage.c

1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/41/1341/1

src/openvpn/manage.c +1 -1
index e46b5f2..6efa100 100644
@@ -612,7 +612,7 @@
                                       : (streq(p1, "udp")) ? PROTO_UDP
                                                            : PROTO_NONE;
 
-                if ((port > 0 && port < UINT16_MAX) && (proto != PROTO_NONE))
+                if ((port > 0 && port <= UINT16_MAX) && (proto != PROTO_NONE))
                 {
                     n_killed = (*man->persist.callback.kill_by_addr)(man->persist.callback.arg,
                                                                      addr, (uint16_t)port, proto);

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1341?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I19373408a82332d7b2e5c634e5509c8be3727b5a
Gerrit-Change-Number: 1341
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>

#2 lore raw
In reply to a message not in the archive

Attention is currently required from: flichtenheld, plaisthos.

cron2 has posted comments on this change by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1341?usp=email )

Change subject: manage: Correctly handle port 65535 in man_kill
......................................................................

Patch Set 1: Code-Review+2

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1341?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: comment
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I19373408a82332d7b2e5c634e5509c8be3727b5a
Gerrit-Change-Number: 1341
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Mon, 03 Nov 2025 11:55:37 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

#3 lore raw

PATCH 1/1 manage: Correctly handle port 65535 in man_kill

In reply to a message not in the archive

From: Frank Lichtenheld <[email protected]...>

Commit c66d433111c958c42cc98f4ba12d3cfc1bd5b3b4 introduced an off-by-one when changing a literal to a constant.

Fixes #887
Change-Id I19373408a82332d7b2e5c634e5509c8be3727b5a

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1341
---

This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master.

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1341
This mail reflects revision 1 of this Change.

Acked-by according to Gerrit (reflected above):
Gert Doering <[email protected]...>

src/openvpn/manage.c +1 -1
index e46b5f2..6efa100 100644
@@ -612,7 +612,7 @@
                                       : (streq(p1, "udp")) ? PROTO_UDP
                                                            : PROTO_NONE;
 
-                if ((port > 0 && port < UINT16_MAX) && (proto != PROTO_NONE))
+                if ((port > 0 && port <= UINT16_MAX) && (proto != PROTO_NONE))
                 {
                     n_killed = (*man->persist.callback.kill_by_addr)(man->persist.callback.arg,
                                                                      addr, (uint16_t)port, proto);
#4 lore raw

[Openvpn-devel] [PATCH applied] Re: manage: Correctly handle port 65535 in man_kill

Trivial fix - and we should have fixed that on the original patch, but due to time constraints around 2.7_rc1 release it did not work out.

Your patch has been applied to the master branch.

commit 40b29347c05e969dc2d23223a426ce652b123589

Author: Frank Lichtenheld
Date:   Mon Nov 3 12:55:46 2025 +0100
     manage: Correctly handle port 65535 in man_kill

     Signed-off-by: Frank Lichtenheld <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1341
     Message-Id: <[email protected]...>
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#5 lore raw
In reply to a message not in the archive

cron2 has uploaded a new patch set (#2) to the change originally created by flichtenheld. ( http://gerrit.openvpn.net/c/openvpn/+/1341?usp=email )

The following approvals got outdated and were removed:
Code-Review+2 by cron2

Change subject: manage: Correctly handle port 65535 in man_kill
......................................................................

manage: Correctly handle port 65535 in man_kill

Commit c66d433111c958c42cc98f4ba12d3cfc1bd5b3b4 introduced an off-by-one when changing a literal to a constant.

Github: fixes OpenVPN/openvpn#887

Change-Id I19373408a82332d7b2e5c634e5509c8be3727b5a

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1341
Message-Id: <[email protected]...>

---
M src/openvpn/manage.c

1 file changed, 1 insertion(+), 1 deletion(-)

git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/41/1341/2

src/openvpn/manage.c +1 -1
index e46b5f2..6efa100 100644
@@ -612,7 +612,7 @@
                                       : (streq(p1, "udp")) ? PROTO_UDP
                                                            : PROTO_NONE;
 
-                if ((port > 0 && port < UINT16_MAX) && (proto != PROTO_NONE))
+                if ((port > 0 && port <= UINT16_MAX) && (proto != PROTO_NONE))
                 {
                     n_killed = (*man->persist.callback.kill_by_addr)(man->persist.callback.arg,
                                                                      addr, (uint16_t)port, proto);

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1341?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: newpatchset
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I19373408a82332d7b2e5c634e5509c8be3727b5a
Gerrit-Change-Number: 1341
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>

#6 lore raw
In reply to a message not in the archive

cron2 has submitted this change. ( http://gerrit.openvpn.net/c/openvpn/+/1341?usp=email )

Change subject: manage: Correctly handle port 65535 in man_kill
......................................................................

manage: Correctly handle port 65535 in man_kill

Commit c66d433111c958c42cc98f4ba12d3cfc1bd5b3b4 introduced an off-by-one when changing a literal to a constant.

Github: fixes OpenVPN/openvpn#887

Change-Id I19373408a82332d7b2e5c634e5509c8be3727b5a

Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1341
Message-Id: <[email protected]...>

---
M src/openvpn/manage.c

1 file changed, 1 insertion(+), 1 deletion(-)
src/openvpn/manage.c +1 -1
index e46b5f2..6efa100 100644
@@ -612,7 +612,7 @@
                                       : (streq(p1, "udp")) ? PROTO_UDP
                                                            : PROTO_NONE;
 
-                if ((port > 0 && port < UINT16_MAX) && (proto != PROTO_NONE))
+                if ((port > 0 && port <= UINT16_MAX) && (proto != PROTO_NONE))
                 {
                     n_killed = (*man->persist.callback.kill_by_addr)(man->persist.callback.arg,
                                                                      addr, (uint16_t)port, proto);

--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/1341?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings?usp=email

Gerrit-MessageType: merged
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I19373408a82332d7b2e5c634e5509c8be3727b5a
Gerrit-Change-Number: 1341
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: cron2 <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>